﻿<UserControl x:Class="Srk.BetaseriesApiApp.Controls.ShowControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Border CornerRadius="4" BorderThickness="4" BorderBrush="Gray">
        <Grid>
            <Grid.Style>
                <Style>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding IsLoaded}" Value="False">
                            <Setter Property="Control.Foreground" Value="Gray" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Grid.Style>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>

            <Label Grid.Row="0" Grid.Column="0" xml:space="preserve">Title: </Label>
            <TextBlock Grid.Row="0" Grid.Column="1" 
                       Text="{Binding Title}" />

            <Label Grid.Row="1" Grid.Column="0" xml:space="preserve">Description: </Label>
            <TextBlock Grid.Row="1" Grid.Column="1" MaxHeight="120"
                       Text="{Binding Description}"
                       TextWrapping="Wrap" ScrollViewer.CanContentScroll="True" />

            <Label Grid.Row="2" Grid.Column="0" xml:space="preserve">Status: </Label>
            <TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Status}" />

            <Label Grid.Row="3" Grid.Column="0" xml:space="preserve">Genres: </Label>
            <ItemsControl Grid.Row="3" Grid.Column="1"
                          ItemsSource="{Binding Genres}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal" />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" Margin="4" />
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>

        </Grid>
    </Border>
</UserControl>
